package com.qingcheng.dao;

import com.qingcheng.pojo.order.Trading;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.time.LocalDate;

public interface TradingMapper extends Mapper<Trading> {

    @Select("SELECT `v_midReturnorderMoney`.`midReturnOrderMoney` midReturnOrderMoney ,`v_midordermoney`.`midOrderMoney` midOrderMoney ,`v_midordernum`.`midOrderNum` midOrderNum, " +
            "`v_realorderitemnum`.`realOrderItemNum`  realOrderItemNum ,`v_realordermoney`.`realOrderMoney` realOrderMoney ,`v_realordernum`.`realOrderNum` realOrderNum, " +
            "`v_totalorderitemnum`.`totalOrderItemNum`  totalOrderItemNum ,`v_totalordernum`.`totalOrderNum` totalOrderNum " +
            "FROM `v_midReturnorderMoney`,`v_midordermoney`,`v_midordernum`,`v_realorderitemnum`,`v_realordermoney`,`v_realordernum`,`v_totalorderitemnum`,`v_totalordernum` " +
            "WHERE v_midReturnOrderMoney.`do_date`=#{do_date} AND `v_midordermoney`.`do_date`=#{do_date} AND `v_midordernum`.`do_date`=#{do_date} AND `v_realorderitemnum`.`do_date`=#{do_date} " +
            "AND `v_realordermoney`.`do_date`=#{do_date} AND `v_realordernum`.`do_date`=#{do_date} AND `v_totalorderitemnum`.`do_date`=#{do_date} AND `v_totalordernum`.`do_date`=#{do_date} ")
    public Trading findTrading(@Param("do_date") LocalDate localDate);
}
